package com.zhijian.wharf.service;

import com.zhijian.util.page.Page;
import com.zhijian.wharf.entity.po.MqttTopic;
import com.zhijian.wharf.entity.vo.request.MqttTopicSaveOrUpdateVo;
import com.zhijian.wharf.entity.vo.request.MqttTopicSearchVo;
import com.zhijian.wharf.entity.vo.response.MqttTopicVo;

import java.util.List;

/**
 * 消息主题 业务处理层
 *
 * @author auto
 * @version 1.0
 * @date 2024-08-12 19:28:30
 */
public interface MqttTopicService {

    /**
     * 主键查询
     *
     * @param id
     * @return
     */
    MqttTopic selectById(Long id);

    /**
     * 主键查询vo
     *
     * @param id
     * @return
     */
    MqttTopicVo selectVoById(Long id);

    /**
     * 按照主键删除
     *
     * @param id
     */
    void deleteById(Long id);

    /**
     * 按照主键批量删除
     *
     * @param idList
     */
    void deleteByIdList(List<Long> idList);

    /**
     * 新增
     *
     * @param mqttTopic
     * @return
     */
    Long insert(MqttTopic mqttTopic);

    /**
     * 动态新增
     *
     * @param mqttTopic
     * @return
     */
    Long insertSelective(MqttTopic mqttTopic);

    /**
     * 更改
     *
     * @param mqttTopic
     * @return
     */
    boolean update(MqttTopic mqttTopic);

    /**
     * 动态修改
     *
     * @param record
     * @return
     */
    boolean updateByPrimaryKeySelective(MqttTopic record);

    /**
     * 保存
     *
     * @param saveOrUpdateVo
     * @return
     */
    boolean save(MqttTopicSaveOrUpdateVo saveOrUpdateVo);

    /**
     * 编辑
     *
     * @param saveOrUpdateVo
     * @return
     */
    boolean modify(MqttTopicSaveOrUpdateVo saveOrUpdateVo);

    /**
     * 列表
     *
     * @param mqttTopicSearchVo
     * @return
     */
    MqttTopicVo selectOne(MqttTopicSearchVo mqttTopicSearchVo);

    /**
     * 总数
     *
     * @param mqttTopicSearchVo
     * @return
     */
    Integer count(MqttTopicSearchVo mqttTopicSearchVo);

    /**
     * 列表
     *
     * @param mqttTopicSearchVo
     * @return
     */
    List<MqttTopicVo> selectList(MqttTopicSearchVo mqttTopicSearchVo);

    /**
     * 分页查询
     *
     * @param mqttTopicSearchVo
     * @return
     */
    Page<MqttTopicVo> selectPage(MqttTopicSearchVo mqttTopicSearchVo);

    /**
     * 批量新增数据（MyBatis原生foreach方法）
     *
     * @param entities 实例对象列表
     * @return 影响行数
     */
    boolean insertBatch(List<MqttTopic> entities);

    /**
     * 动态删除，慎重用此方法！！
     *
     * @param mqttTopicSearchVo
     * @return
     */
    void deleteByCondition(MqttTopicSearchVo mqttTopicSearchVo);

    /**
     * 发布
     *
     * @param id
     * @return
     */
    boolean publish(Long id);

    /**
     * 订阅
     *
     * @param id
     * @param userId
     * @return
     */
    boolean sub(Long id, Long userId);
}